<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  <title>pub</title>
</head>
<body>

    <div id="app">
        <el-input  type="textarea"   :rows="2"    placeholder="请输入推送内容"  v-model="textarea">
      </el-input>
      <el-button type="primary" @click="getKeys">推送消息</el-button> 
    </div>
   
    <script src="https://cdn.bootcss.com/axios/0.19.0-beta.1/axios.min.js"></script>
    <script src="https://cdn.bootcss.com/vue/2.6.10/vue.js"></script>
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script>
        new Vue({
          el: '#app',
          data: {
            textarea: ''
          },
          created () {
          
          },
          methods: {
            getKeys () {
              axios.request({
                url: '/api/pubScription',
                method: 'post',
                headers: {
                  'Content-Type': 'application/json'  
                },
                data: {pubMessage: this.textarea}
              }).then(res => {
                console.log(res)
              })
            }
          }
        })
    </script>
</body>
</html>